import { dictApi } from '@/api/dict/dict-api'

const useAppStore = {
  state: {
	// 字典列表
	dictList: [],
  },

  actions: {
	getDictListAction({ commit, state }) {
	  return new Promise((resolve, reject) => {
	    dictApi.useDictTypeAllApi().then((res) => {
		  const data = JSON.stringify(res.data)
	      state.dictList = data
	      resolve()
	    }).catch(error => {
	      reject(error)
	    })
	  })
	}
  }
}

export default useAppStore